/*  cell base class for ND++ minesweeeper game
Programmer:  Prof. Scott

These functions are implementations of a base class for two types of cells:  bomb cells and non-bomb (called 
quadrant) cells

Please refer to cell.h for more generic description of this base class.

*/

#include "cell.h"   // include base class


// non default constructor;  isBomb is set to 0 by default given the parameter in the class header
Cell::Cell (int bombValue) : isBomb (bombValue) {

  isFlagged = 0;   // cell is also not flagged at the start

}

// "get" function for isBomb, simply an interface to this private datum
int Cell::checkIfBomb() {

  return (isBomb);

}

// "get" function for isFlagged, simply an interface to this private datum
int Cell::checkIfFlagged() {

  return (isFlagged);

}

// "flip" flag such that if it is 0 it is now 1, and if it is 1 it becomes 0
void Cell::flipFlag() {

  isFlagged = (isFlagged + 1) % 2;  // use mod to "flip" this "bit"

}


// placeholder base class implementation for getNeighbors; returns "dummy" value
int Cell::getNeighbors() {

  return (-1);

}

// placeholder base class implementation for setNeighbors; does nothing
void Cell::setNeighbors(int newValue) { }


